<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: app
  Date: 2018/7/28
  Time: 下午8:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<html>
<head>
    <title>${doeBookEntity.bname}(豆瓣酱)</title>
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <style>
        body{
            -webkit-font-smoothing: antialiased;
        }
        a{
            text-decoration: none;
        }
        .book-information {
            position: relative;
            z-index: 2;
            margin-bottom: 30px;
            padding-bottom: 20px;
            background: #fff;
        }
        .book-information .book-img {
            float: left;
            width: 144px;
            height: 192px;
            margin: 20px 20px 0;
            border: #000 solid 1px;
            overflow: hidden;
        }
        .book-information .book-img a img{
            position: relative;
            display: block;
            overflow: hidden;
            width: 100%;
            height: 100%;
            box-shadow: 0 1px 6px rgba(0,0,0,.35), 0 0 5px #f9f2e9 inset;
            cursor: pointer;
            transition: all 0.6s ease-out;
        }
        .book-information .book-img a img:hover{
            transform: scale(1.1);
        }
        .book-information .book-info{
            float: left;
            width: 560px;
            margin-top: 20px;
        }
        .book-information .book-info .tags span,
        .book-information .book-info .tags a{
            font: 12px/22px PingFangSC-Regular,'-apple-system',Simsun;
            display: inline-block;
            overflow: hidden;
            height: 22px;
            margin-right: 12px;
            padding: 0 10px 10px;
            text-align: center;
            vertical-align: middle;
            border-width: 1px;
            border-style: solid;
            border-radius: 15px;
            text-decoration: none;
        }
        .book-information .book-info .tags a.red{
            margin-top: 5px;
            transition: border .3s;
            color: #bf2c24;
            border-color: #ffb0b4;
        }
        .book-information .book-info .tags a.red:hover{
            color: #bf2c24;
            border-color: #bf2c24;
        }
        .book-information .book-info .tags a.blue{
            margin-top: 5px;
            transition: border .3s;
            color: #3f5a93;
            border-color: #9fadc9;
        }
        .book-information .book-info .tags a.blue:hover{
            color: #3f5a93;
            border-color: #3f5a93;
        }


    </style>
</head>
<body>

<div class="container"style="margin-bottom:50px">
    <div class="row">
        <div class="col-lg-10">
            <h1 style="padding-top: 30px;padding-left: 20px">${doeBookEntity.bname}</h1>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-2">
            <div class="book-information">

                <div class="book-img">
                    <a>
                        <img alt="140x140" src=${doeBookEntity.burl}  style="height:192px;width:144px" />
                    </a>
                </div>
                <div class="book-info" style="padding-left: 20px">
                    <%--<span>ISBN：</span> ${doeBookEntity.isbn}<br>--%>
                    <%--<span>作者：</span> ${doeBookEntity.author}<br>--%>
                    <p class="tags">
                        <c:forEach items="${bookRefTags}" var="currentTag" varStatus="status">
                            <c:choose>
                                <c:when test="${status.index == 4}">
                                    <br>
                                    <a class="blue"  name="searchContent" id="searchContent" href="searchByTagAction?searchContent=${currentTag}">${currentTag}</a>

                                </c:when>
                                <c:when test="${status.index < 4}">
                                    <a class="red"  href="searchByTagAction?searchContent=${currentTag}">${currentTag}</a>
                                </c:when>
                                <c:otherwise>
                                    <a class="blue" target="_blank" href="searchByTagAction?searchContent=${currentTag}">${currentTag}</a>
                                </c:otherwise>
                            </c:choose>
                        </c:forEach>
                    </p>

                </div>
            </div>
        </div>
        <div class="col-lg-4">
            <h3><span>评&nbsp&nbsp分：</span>${doeBookEntity.bscore}</h3>
            <span>作&nbsp&nbsp&nbsp&nbsp者：</span>${doeBookEntity.bauthor}<br>
            <div><span>定&nbsp&nbsp&nbsp&nbsp价：</span>${doeBookEntity.bprice}<br></div>
            <div style="margin-top: 10px">
                <%--<a id="source" href="https://book.douban.com/subject/${doeBookEntity.bookId}/?icn=index-editionrecommend">--%>
                    <%--<input type="button" value="更多信息" >--%>
                <%--</a>--%>
                <a id="shoppingTrolley" style="margin-left:5px">
                    <input type="button" value="加购物车" onclick="forward('${sessionScope.uid}','${doeBookEntity.bid}')">
                </a>
                <a id="buy" style="margin-left:5px">
                    <input id="purchase" type="button" value="购买本书" onclick="location='generateOrderAction?bid=${doeBookEntity.bid}'"/>
                </a>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-2" style="padding-left: 30px">
            <span style="color: green"><h4>内容简介……</h4></span>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-8" style="padding-left: 30px">
            &nbsp&nbsp&nbsp&nbsp
            ${doeBookEntity.btext}
        </div>
    </div>

    <%--<div class="row">--%>
        <%--<div class="col-lg-2" style="padding-left: 30px">--%>
            <%--<span style="color: green"><h4>作者简介……</h4></span>--%>
        <%--</div>--%>
    <%--</div>--%>

    <%--<div class="row">--%>
        <%--<div class="col-lg-8" style="padding-left: 30px">--%>
            <%--&nbsp&nbsp&nbsp&nbsp--%>
            <%--${doeBookEntity.authorDes}--%>
        <%--</div>--%>
    <%--</div>--%>
</div>
</body>
</html>

<script>
    function forward(var1,var2) {
        $.ajax({
            type: "POST",
            url: "insertShopTrolleyAction",
            data:"user_id="+var1+"&bookId="+var2,
            error:function () {
                alert("错误");
            },
            success:function (msg) {
                var message = msg["message"]
                alert(message);
            }

        });
    }
</script>
